package com.taobao.api.request;

import java.util.Date;
import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.TaobaoRequest;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.response.PictureGetResponse;

/**
 * TOP API: taobao.picture.get request
 * 
 * @author auto create
 * @since 1.0, 2013-07-21 16:38:14
 */
public class PictureGetRequest implements TaobaoRequest<PictureGetResponse> {

  private Map<String, String> headerMap = new TaobaoHashMap();
  private TaobaoHashMap       udfParams;                      // add
                                                              // user-defined
                                                              // text parameters
  private Long                timestamp;

  /**
   * 是否删除,unfroze代表没有删除
   */
  private String              deleted;

  /**
   * 查询上传结束时间点,格式:yyyy-MM-dd HH:mm:ss
   */
  private Date                endDate;

  /**
   * 图片被修改的时间点，格式:yyyy-MM-dd HH:mm:ss。查询此修改时间点之后到目前的图片。
   */
  private Date                modifiedTime;

  /**
   * 图片查询结果排序,time:desc按上传时间从晚到早(默认),
   * time:asc按上传时间从早到晚,sizes:desc按图片从大到小，sizes:asc按图片从小到大,默认time:desc
   */
  private String              orderBy;

  /**
   * 页码.传入值为1代表第一页,传入值为2代表第二页,依此类推,默认值为1
   */
  private Long                pageNo;

  /**
   * 每页条数.每页返回最多返回100条,默认值40
   */
  private Long                pageSize;

  /**
   * 图片分类ID
   */
  private Long                pictureCategoryId;

  /**
   * 图片ID
   */
  private Long                pictureId;

  /**
   * 查询上传开始时间点,格式:yyyy-MM-dd HH:mm:ss
   */
  private Date                startDate;

  /**
   * 图片标题,最大长度50字符,中英文都算一字符
   */
  private String              title;

  public void setDeleted(String deleted) {
    this.deleted = deleted;
  }

  public String getDeleted() {
    return this.deleted;
  }

  public void setEndDate(Date endDate) {
    this.endDate = endDate;
  }

  public Date getEndDate() {
    return this.endDate;
  }

  public void setModifiedTime(Date modifiedTime) {
    this.modifiedTime = modifiedTime;
  }

  public Date getModifiedTime() {
    return this.modifiedTime;
  }

  public void setOrderBy(String orderBy) {
    this.orderBy = orderBy;
  }

  public String getOrderBy() {
    return this.orderBy;
  }

  public void setPageNo(Long pageNo) {
    this.pageNo = pageNo;
  }

  public Long getPageNo() {
    return this.pageNo;
  }

  public void setPageSize(Long pageSize) {
    this.pageSize = pageSize;
  }

  public Long getPageSize() {
    return this.pageSize;
  }

  public void setPictureCategoryId(Long pictureCategoryId) {
    this.pictureCategoryId = pictureCategoryId;
  }

  public Long getPictureCategoryId() {
    return this.pictureCategoryId;
  }

  public void setPictureId(Long pictureId) {
    this.pictureId = pictureId;
  }

  public Long getPictureId() {
    return this.pictureId;
  }

  public void setStartDate(Date startDate) {
    this.startDate = startDate;
  }

  public Date getStartDate() {
    return this.startDate;
  }

  public void setTitle(String title) {
    this.title = title;
  }

  public String getTitle() {
    return this.title;
  }

  public Long getTimestamp() {
    return this.timestamp;
  }

  public void setTimestamp(Long timestamp) {
    this.timestamp = timestamp;
  }

  public String getApiMethodName() {
    return "taobao.picture.get";
  }

  public Map<String, String> getTextParams() {
    TaobaoHashMap txtParams = new TaobaoHashMap();
    txtParams.put("deleted", this.deleted);
    txtParams.put("end_date", this.endDate);
    txtParams.put("modified_time", this.modifiedTime);
    txtParams.put("order_by", this.orderBy);
    txtParams.put("page_no", this.pageNo);
    txtParams.put("page_size", this.pageSize);
    txtParams.put("picture_category_id", this.pictureCategoryId);
    txtParams.put("picture_id", this.pictureId);
    txtParams.put("start_date", this.startDate);
    txtParams.put("title", this.title);
    if (this.udfParams != null) {
      txtParams.putAll(this.udfParams);
    }
    return txtParams;
  }

  public void putOtherTextParam(String key, String value) {
    if (this.udfParams == null) {
      this.udfParams = new TaobaoHashMap();
    }
    this.udfParams.put(key, value);
  }

  public Class<PictureGetResponse> getResponseClass() {
    return PictureGetResponse.class;
  }

  public void check() throws ApiRuleException {
  }

  public Map<String, String> getHeaderMap() {
    return headerMap;
  }
}
